package com.example.doctor.controller.IM;

import com.example.common.support.Result;
import com.example.doctor.dto.req.*;
import com.example.doctor.dto.resp.*;
import com.example.doctor.service.QaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author sifan
 * @PackagName:com.example.doctor.controller.IM
 * @ClassName: QAController
 * @Description:
 * @date:2021/1/26 11:47
 */
@RestController
@Api(tags = "随访管理")
@RequestMapping("/api/IM/QA")
public class QAController {

    @Resource
    QaService qaService;

    @ApiOperation(value = "问诊 随访 列表")
    @PostMapping("/List")
    public Result<Map<String, Object>> list(@RequestBody NoticeListReq req){
        Map<String, Object> qaListRspList = qaService.list(req);
        return Result.success(qaListRspList);
    }

    @ApiOperation(value = "问诊 随访 详情")
    @PostMapping("/Info")
    public Result<QaInfoRsp> Info(@RequestBody QaInfoReq qaInfoReq){
        QaInfoRsp qaInfoRsp = qaService.Info(qaInfoReq);
        return Result.success(qaInfoRsp);
    }

    @ApiOperation(value = "问诊 随访 编辑")
    @PostMapping("/SaveQA")
    public Result<HashMap<String,Object>> SaveQA(@RequestBody SaveQAReq saveQAReq){
        HashMap<String,Object> hashMap = qaService.SaveQA(saveQAReq);
        return Result.success(hashMap);
    }

    @ApiOperation(value = "问诊 随访 删除")
    @PostMapping("/Del")
    public Result<HashMap<String,Object>> Del(@RequestBody DelReq delReq){
        HashMap<String,Object> hashMap = qaService.Del(delReq);
        return Result.success(hashMap);
    }

    @ApiOperation(value = " 随访记录")
    @PostMapping("/Notes")
    public Result< Map<String,Object>> Notes(@RequestBody NoticeListReq req){
        Map<String,Object> notesRspList = qaService.Notes(req);
        return Result.success(notesRspList);
    }

    @ApiOperation(value = "随访参与")
    @PostMapping("/TakePart")
    public Result<TakePartRsp> TakePart(@RequestBody TakePartReq takePartReq){
        TakePartRsp takePartRsp = qaService.TakePart(takePartReq);
        return Result.success(takePartRsp);
    }

    @ApiOperation(value = " 问诊 随访 发送")
    @PostMapping("/Send")
    public Result<HashMap<String,Object>> Send(@RequestBody SendReq sendReq){
        HashMap<String,Object> hashMap = qaService.Send(sendReq);
        return Result.success(hashMap);
    }

    @ApiOperation(value = "问诊 随访 反馈")
    @PostMapping("/Back")
    public Result<BackRsp> Back(@RequestBody BackReq backReq){
        BackRsp backRsp = qaService.Back(backReq);
        return Result.success(backRsp);
    }

}
